package com.zk.ppa.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.zk.ppa.dao.po.Family;
import com.zk.ppa.dao.repository.FamilyRepository;
import com.zk.ppa.service.FamilyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;
import java.util.List;

/**
 * @author Mr.yang
 * @create 2021-03-24 22:27
 */
@Service
public class FamilyServiceImpl implements FamilyService {

    @Autowired
    private FamilyRepository familyRepository;

    @Override
    public Boolean saveFamily(Family family){
        return familyRepository.save(family);
    }

    @Override
    public List<Family> getFamily() {
        return familyRepository.list();
    }

    @Override
    public Family getFamilyById(long Id) {
        return familyRepository.getById(Id);
    }

    @Override
    public Boolean updateFamily(Family family) {
        return familyRepository.updateById(family);
    }

    @Override
    public Boolean deleteFamily(long Id) {
        return familyRepository.removeById(Id);
    }
}
